home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 August: Tool Chest / Dev.CD Aug 95 TC / Dev.CD Aug 95 TC.toast / Tool Chest / Interfaces / UniversalInterfaces 2.0 / PInterfaces / Dictionary.p < prev    next >
Encoding:
Text File  |  1995-04-18  |  4.1 KB  |  147 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        Dictionary.p
  3.  
  4.      Contains:    Dictionary Manager Interfaces
  5.  
  6.      Version:    Technology:    System 7.5
  7.                  Package:    Universal Interfaces 2.0 in “MPW Latest” on ETO #17
  8.  
  9.      Copyright:    © 1984-1995 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, use the Apple Bug Reporter
  13.                  stack.  Include the file and version information (from above)
  14.                  in the problem description and send to:
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT Dictionary;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __DICTIONARY__}
  30. {$SETC __DICTIONARY__ := 1}
  31.  
  32. {$I+}
  33. {$SETC DictionaryIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __FILES__}
  43. {$I Files.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    OSUtils.p                                                    }
  47. {        Memory.p                                                }
  48.  
  49. {$PUSH}
  50. {$ALIGN MAC68K}
  51. {$LibExport+}
  52.  
  53. CONST
  54. { Dictionary data insertion modes }
  55.     kInsert                        = 0;                            { Only insert the input entry if there is nothing in the dictionary that matches the key. }
  56.     kReplace                    = 1;                            { Only replace the entries which match the key with the input entry. }
  57.     kInsertOrReplace            = 2;                            { Insert the entry if there is nothing in the dictionary which matches the key. 
  58.                            If there is already matched entries, replace the existing matched entries with the input entry. }
  59.  
  60. { This Was InsertMode }
  61.     
  62. TYPE
  63.     DictionaryDataInsertMode = INTEGER;
  64.  
  65.  
  66. CONST
  67. { Key attribute constants }
  68.     kIsCaseSensitive            = $10;                            { case sensitive = 16        }
  69.     kIsNotDiacriticalSensitive    = $20;                            { diac not sensitive = 32    }
  70.  
  71. { Registered attribute type constants.    }
  72.     kNoun                        = -1;
  73.     kVerb                        = -2;
  74.     kAdjective                    = -3;
  75.     kAdverb                        = -4;
  76.  
  77. { This Was AttributeType }
  78.     
  79. TYPE
  80.     DictionaryEntryAttribute = SInt8;
  81.  
  82. { Dictionary information record }
  83.     DictionaryInformation = RECORD
  84.         dictionaryFSSpec:        FSSpec;
  85.         numberOfRecords:        SInt32;
  86.         currentGarbageSize:        SInt32;
  87.         script:                    ScriptCode;
  88.         maximumKeyLength:        SInt16;
  89.         keyAttributes:            SInt8;
  90.     END;
  91.  
  92.     DictionaryAttributeTable = PACKED RECORD
  93.         datSize:                UInt8;
  94.         datTable:                PACKED ARRAY [0..0] OF DictionaryEntryAttribute;
  95.     END;
  96.  
  97.     DictionaryAttributeTablePtr = ^DictionaryAttributeTable;
  98.  
  99.  
  100. FUNCTION InitializeDictionary({CONST}VAR theFsspecPtr: FSSpec; maximumKeyLength: SInt16; keyAttributes: ByteParameter; script: ScriptCode): OSErr;
  101.     {$IFC NOT GENERATINGCFM}
  102.     INLINE $303C, $0500, $AA53;
  103.     {$ENDC}
  104. FUNCTION OpenDictionary({CONST}VAR theFsspecPtr: FSSpec; accessPermission: ByteParameter; VAR dictionaryReference: SInt32): OSErr;
  105.     {$IFC NOT GENERATINGCFM}
  106.     INLINE $303C, $0501, $AA53;
  107.     {$ENDC}
  108. FUNCTION CloseDictionary(dictionaryReference: SInt32): OSErr;
  109.     {$IFC NOT GENERATINGCFM}
  110.     INLINE $303C, $0202, $AA53;
  111.     {$ENDC}
  112. FUNCTION InsertRecordToDictionary(dictionaryReference: SInt32; key: ConstStr255Param; recordDataHandle: Handle; whichMode: DictionaryDataInsertMode): OSErr;
  113.     {$IFC NOT GENERATINGCFM}
  114.     INLINE $303C, $0703, $AA53;
  115.     {$ENDC}
  116. FUNCTION DeleteRecordFromDictionary(dictionaryReference: SInt32; key: ConstStr255Param): OSErr;
  117.     {$IFC NOT GENERATINGCFM}
  118.     INLINE $303C, $0404, $AA53;
  119.     {$ENDC}
  120. FUNCTION FindRecordInDictionary(dictionaryReference: SInt32; key: ConstStr255Param; requestedAttributeTablePointer: DictionaryAttributeTablePtr; recordDataHandle: Handle): OSErr;
  121.     {$IFC NOT GENERATINGCFM}
  122.     INLINE $303C, $0805, $AA53;
  123.     {$ENDC}
  124. FUNCTION FindRecordByIndexInDictionary(dictionaryReference: SInt32; recordIndex: SInt32; requestedAttributeTablePointer: DictionaryAttributeTablePtr; VAR recordKey: Str255; recordDataHandle: Handle): OSErr;
  125.     {$IFC NOT GENERATINGCFM}
  126.     INLINE $303C, $0A06, $AA53;
  127.     {$ENDC}
  128. FUNCTION GetDictionaryInformation(dictionaryReference: SInt32; VAR theDictionaryInformation: DictionaryInformation): OSErr;
  129.     {$IFC NOT GENERATINGCFM}
  130.     INLINE $303C, $0407, $AA53;
  131.     {$ENDC}
  132. FUNCTION CompactDictionary(dictionaryReference: SInt32): OSErr;
  133.     {$IFC NOT GENERATINGCFM}
  134.     INLINE $303C, $0208, $AA53;
  135.     {$ENDC}
  136.  
  137. {$ALIGN RESET}
  138. {$POP}
  139.  
  140. {$SETC UsingIncludes := DictionaryIncludes}
  141.  
  142. {$ENDC} {__DICTIONARY__}
  143.  
  144. {$IFC NOT UsingIncludes}
  145.  END.
  146. {$ENDC}
  147.